Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: upgrade forc@0.58.0 and remove V0 encoding #2238

Merged
merged 30 commits into from
May 14, 2024

Conversation

danielbate
Copy link
Contributor

@danielbate danielbate commented May 6, 2024

Closes #2041
Closes #2109
Closes #2005
Closes #922

This PR:

  • Upgrades forc to 0.58.0
  • Enables V1 encoding for configurable constants
  • Removes all references and specific logic for V0 encoding
  • Removes any output or pointer specific logic for heap types that were required for V0
  • Removes V0 coders
  • Removes experimental V1 tests as everything is covered
  • Flattened the coder directory structure
  • Adds a padToWordSize: boolean encoding option for use inside transactions for number and boolean values

Breaking Changes:

We no longer support V0 encoding, meaning the version itself and it's encoding options can no longer be passed to AbiCoder.

// Before
const options: EncodingOptions = {
    encoding: ENCODING_V0,
    isSmallBytes: true,
    isRightPadded: true
};

// After
const options: EncodingOptions = {
    encoding: ENCODING_V1,
    padToWordSize: true
};

@danielbate danielbate added feat Issue is a feature blocked labels May 6, 2024
@danielbate danielbate self-assigned this May 6, 2024
@danielbate danielbate changed the title feat!: remove V0 encoding feat!: upgrade forc@0.57.0 and remove V0 encoding May 13, 2024
@danielbate danielbate marked this pull request as ready for review May 13, 2024 18:51
@fuel-service-user
Copy link
Contributor

fuel-service-user commented May 13, 2024

✨ A PR has been created under the rc-2238 tag on fuels-wallet repo.
FuelLabs/fuels-wallet#1292

@danielbate danielbate changed the title feat!: upgrade forc@0.57.0 and remove V0 encoding feat!: upgrade forc@0.58.0 and remove V0 encoding May 14, 2024
Copy link
Contributor

@petertonysmith94 petertonysmith94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - some small comments 🚀 🌔

.changeset/twelve-brooms-reflect.md Outdated Show resolved Hide resolved
maschad
maschad previously approved these changes May 14, 2024
Copy link
Member

@maschad maschad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Left some suggestions

@Torres-ssf Torres-ssf enabled auto-merge (squash) May 14, 2024 21:43
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
79.79%(+0.25%) 70.47%(+0.63%) 76.85%(-0.27%) 79.88%(+0.23%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/abi-coder/src/AbiCoder.ts 75%
(+0%)
0%
(-100%)
66.66%
(+0%)
75%
(+0%)
🔴 packages/abi-coder/src/FunctionFragment.ts 65.38%
(-4.18%)
60%
(-9.69%)
71.42%
(-1.91%)
64.81%
(-4.63%)
🔴 packages/abi-coder/src/Interface.ts 72%
(+0%)
60%
(-2.5%)
76.92%
(+0%)
71.42%
(+0%)
✨ packages/abi-coder/src/encoding/coders/ArrayCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/B256Coder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/B512Coder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/BigNumberCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/BooleanCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/ByteCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/EnumCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/NumberCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/OptionCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
🔴 ✨ packages/abi-coder/src/encoding/coders/RawSliceCoder.ts 94.44%
(+94.44%)
83.33%
(+83.33%)
100%
(+100%)
94.44%
(+94.44%)
✨ packages/abi-coder/src/encoding/coders/StdStringCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/StrSliceCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/StringCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/StructCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/TupleCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/abi-coder/src/encoding/coders/VecCoder.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
🔴 packages/abi-coder/src/encoding/strategies/getCoderV1.ts 91.48%
(-0.18%)
86.66%
(+0%)
100%
(+0%)
91.66%
(+0%)
🔴 packages/abi-coder/src/utils/constants.ts 97.36%
(-0.07%)
100%
(+0%)
0%
(+0%)
97.36%
(-0.07%)
🔴 packages/abi-coder/src/utils/utilities.ts 20%
(-76.49%)
0%
(-80%)
50%
(-50%)
27.27%
(-69.45%)
🔴 packages/account/src/account.ts 82.78%
(-0.22%)
66.66%
(+0%)
76%
(+0%)
82.35%
(-0.23%)
🔴 packages/account/src/mnemonic/utils.ts 97.61%
(+19.15%)
91.66%
(+28.03%)
100%
(+0%)
97.77%
(+18.06%)
🔴 packages/account/src/predicate/predicate.ts 24.19%
(+1.81%)
31.25%
(+0%)
13.33%
(+0.83%)
23.07%
(+1.65%)
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 85.91%
(+0.4%)
75%
(+2.17%)
86%
(-0.53%)
86.3%
(+0.4%)
🔴 packages/account/src/providers/transaction-summary/call.ts 6.25%
(+1.49%)
0%
(+0%)
0%
(+0%)
6.25%
(+1.49%)
🔴 packages/program/src/contract-call-script.ts 10.97%
(+0.14%)
0%
(+0%)
0%
(+0%)
10.58%
(+0.02%)
🔴 packages/program/src/functions/multicall-scope.ts 0%
(+0%)
100%
(+100%)
0%
(+0%)
0%
(+0%)
🔴 ✨ packages/utils/src/utils/toUtf8Bytes.ts 88%
(+88%)
84.61%
(+84.61%)
100%
(+100%)
88.46%
(+88.46%)
🔴 ✨ packages/utils/src/utils/toUtf8String.ts 94.64%
(+94.64%)
92.3%
(+92.3%)
100%
(+100%)
94.73%
(+94.73%)

@Torres-ssf Torres-ssf merged commit 64e9659 into master May 14, 2024
19 checks passed
@Torres-ssf Torres-ssf deleted the db/feat/deprecate-v0 branch May 14, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
6 participants